import uiautomator2 as u2
from adbutils import adb

device_1 = '00000000d5328bbf'
d_one = u2.connect(device_1)
d_one_device = adb.device(serial=device_1)


if __name__ == '__main__':
    # adb_device.root()
    # adb_device.shell([r"sendevent /dev/input/event0 1 353 1", r"sendevent /dev/input/event0 0 0 0"])
    # adb_device.shell(r"sendevent /dev/input/event0 1 353 1")
    # res = adb_device.shell("< test.txt")
    # res = adb_device.shell("./data/test.sh")
    # res = adb_device.shell(
    #     "su & sendevent /dev/input/event0 1 353 1 & sendevent /dev/input/event0 0 0 0 & echo 'down' & sleep 3 & sendevent /dev/input/event0 1 353 0 & sendevent /dev/input/event0 0 0 0 & echo 'up'")
    # print(res)
    # res = d_one.app_current()
    # d_one(text="开启投屏").click()
    # print(res)
    res = d_one.info
    print(res)
    pass
